A network packet includes multiple traffic or protocol layers, where each layer is independent of other layers. While traditional hardware implementations provide parsing abilities, the traditional hardware implementations are inflexible and resource inefficient. A limitation of such inflexibility and inefficiency is the maximum length of the individual layers. This limitation is dictated by a field selection circuit that must be built in hardware. The logic that goes into the hardware is directly proportional to the maximum layer length. For example, to extract “T” total bytes in a programmable way from a layer, where the layer can be of size “L” bytes, the total number of byte MUXes required for that layer is T*(L:1) MUXes. Thus, the bigger “L” is, the bigger the size of the field selection circuit is, which increases hardware costs. If a parser engine is able to handle multiple layers in a packet, then the overall MUX structure cost is the size of the field selection circuit multiplied by the number of layers the parser engine supports.